This notebook intends to provide a map representation of information DC bike share ridership
library(gbfs)
Warning: package ‘gbfs’ was built under R version 4.3.2
library(here)
here() starts at C:/Users/naida/OneDrive/Desktop/f23/intro to ds/ds241_f23
library(janitor)
Attaching package: ‘janitor’
The following objects are masked from ‘package:stats’:
chisq.test, fisher.test
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────────────────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.3 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.4.4 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.0
✔ purrr 1.0.2 ── Conflicts ────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the ]8;;http://conflicted.r-lib.org/conflicted package]8;; to force all conflicts to become errors
library(openmeteo)
Warning: package ‘openmeteo’ was built under R version 4.3.2
library(lubridate)
library(sf) # working with simple features - geospatial
Warning: package ‘sf’ was built under R version 4.3.2Linking to GEOS 3.11.2, GDAL 3.7.2, PROJ 9.3.0; sf_use_s2() is TRUE
library(tmap)
Warning: package ‘tmap’ was built under R version 4.3.2Breaking News: tmap 3.x is retiring. Please test v4, e.g. with
remotes::install_github('r-tmap/tmap')
library(tidycensus)
Warning: package ‘tidycensus’ was built under R version 4.3.2
df1= st_read(here("data_raw",
"Crime_Incidents_in_2022.geojson")) %>%
clean_names()
Reading layer `Crime_Incidents_in_2022' from data source
`C:\Users\naida\OneDrive\Desktop\f23\intro to ds\ds241_f23\data_raw\Crime_Incidents_in_2022.geojson'
using driver `GeoJSON'
Simple feature collection with 27137 features and 23 fields
Geometry type: POINT
Dimension: XY
Bounding box: xmin: -77.11364 ymin: 38.81467 xmax: -76.91002 ymax: 38.99491
Geodetic CRS: WGS 84
tmap_mode("view")
tmap mode set to interactive viewing
tm_shape(df1)+
tm_facets("offense")+
tm_dots("offense", legend.show = FALSE)